
#ifndef __HITTABLE_H__
#define __HITTABLE_H__

#include "rt.hh"
#include "ray.hh"

class material;

struct hit_record {
	point3 point;
	vec3 normal;
	double t;
	bool front_face;
	shared_ptr<material> pmat;

	inline void set_face_normal(const ray& r, const vec3& outward_normal) {
		front_face = dot(r.direction(), outward_normal) < 0;
		normal = front_face ? outward_normal : -outward_normal;
	}
};

class hittable {
	public : 
		virtual bool hit(const ray& r, double min_t, double max_t, hit_record& rec)	const = 0;
};

#endif
